<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="shortcut icon" href="images/icons/favicon.ico" />
		<link href="style.less" rel="stylesheet/less" type="text/css" />
		<script src="jquery.js" type="text/javascript"></script>
		<script src="functions.js" type="text/javascript"></script>
		<script src="less.js" type="text/javascript"></script>
		<title>Puzzled</title>
	</head>
	<body>
		<input type="hidden" id="autoFocus" value="" />
		<div onclick="clearMsgs()" id="msgs">
			<c:forEach items="${msgs.fetchAll()}" var="msg">
				<p class="<c:out value="${msg.findClass()}" />">
					<c:out value="${msg.getMsg()}" />
				</p>
			</c:forEach>
	 	</div>
		<div id="container">
			<div id="header">
				<div id="userstatus">
					<c:choose>
						<c:when test="${user==null}">
							You are not logged in, please 
							<a href="/Puzzled/Puzzled?todo=login">login</a> 
							or 
							<a href="/Puzzled/Puzzled?todo=register">register</a>
						</c:when>
						<c:otherwise>
							Welcome, <c:out value="${user.getUserName()}" />
							[<img title="Puzzle Points!" class="pp" src="images/icons/pp.png" /> <c:out value="${user.getPoints()}" />] | 
							<a href="/Puzzled/Puzzled?todo=logout">logout</a>
						</c:otherwise>
					</c:choose>
				</div>
				<img title="Home" onclick="window.location='/Puzzled/Puzzled?todo=index'" src="images/logo.png" />
				<br />
				<button onclick="window.location='/Puzzled/Puzzled?todo=scores'">High Scores!</button>
			</div>
			<div id="content">
				<h1>Easy Sodoku</h1>
				<form id="newEasy" method="post" action="/Puzzled/Puzzled">
					<input type="hidden" name="todo" value="new" />
					<input type="hidden" name="level" value="1" />
				</form>
				<img title="New Easy Sodoku" onclick="newPuzzle('#newEasy')" src="images/easy-ss.png" />
				
				<h1>Medium Sodoku</h1>
				<form id="newMedium" method="post" action="/Puzzled/Puzzled">
					<input type="hidden" name="todo" value="new" />
					<input type="hidden" name="level" value="2" />
				</form>
				<img title="New Medium Sodoku" onclick="newPuzzle('#newMedium')" src="images/medium-ss.png" />
				
				<h1>Hard Sodoku</h1>
				<form id="newHard" method="post" action="/Puzzled/Puzzled">
					<input type="hidden" name="todo" value="new" />
					<input type="hidden" name="level" value="3" />
				</form>
				<img title="New Hard Sodoku" onclick="newPuzzle('#newHard')" src="images/hard-ss.png" />
			</div>
			<div id="footer">
				Copyright &copy; 2011-2012 AwesomeInc
			</div>
		</div>
	</body>
</html>